<?php
/*******************************************
 *                  8hjie                  *
 *                                         *
 *                 操作记录                *
 *                                         *
 *                 18-1-15                 *
 *                Wanghuabin               *
 *                                         *
 *******************************************/
namespace Home\Controller;
use Think\Controller;
class RecordController extends CommonController {
    /**
     * [packet_log 设置红包记录]
     * @param  [type]  $user_id [用户ID]
     * @param  [type]  $content [记录内容]
     * @param  integer $type    [类型]
     * @return [type]           [json]
     */
    public function packet_log($user_id,$content,$type=1){
        $data['content'] = $content;
        $data['type'] = $type;
        $data['user_id'] = $user_id;
        $data['add_time'] = time();
        $r = M('Record')->data($data)->add();
        if($r){
            $data = array('err'=>0,'msg'=>"记录成功！");
        }else{
            $data = array('err'=>1,'msg'=>"记录失败！");
        }
        return($data);
    }
}